<!DOCTYPE html>
<html>

<head>
    <title>{$category.name|default=" "} {$car.post_title?=$car.title} - {$site_info.site_name}</title>
    <meta name="keywords" content="{$car.post_keywords?=$site_info.site_seo_keywords}" />
    <meta name="description" content="{$car.post_excerpt?=$site_info.site_seo_description}">
    <include file="public@head" />
    <script>
        Wind.css('layer');
    </script>
    <style>
        #car_content img {
            height: auto !important;
            max-width: 100%;
        }
        
        #car_content {
            word-wrap: break-word;
        }
        
        .layui-layer-imgprev {
            left: 10px;
            background-position: -80px -5px;
        }
        
        .layui-layer-imgprev:hover {
            background-position: -129px -5px;
        }
        
        .layui-layer-imgnext {
            right: 10px;
            background-position: -78px -50px;
        }
        
        .layui-layer-imgnext:hover {
            background-position: -129px -50px;
        }
        
        .layui-layer-setwin .layui-layer-close2 {
            right: 0px;
            top: 0px;
        }
    </style>
    <hook name="before_head_end" />
</head>

<body class="body-black">
    <include file="public@nav" />
    <div class="container tc-main">
        <div class="list-head">
            <ul>
                <li id="tab" class="tab_1 {$category.id==0?'active': ''}"><a href="{:cmf_url('List/index')}">所有车型</a></li>
                <volist name="categorys" id="vo">
                    <neq name="vo:id" value="$rental_category">
                        <li id="tab" class="tab_2 {$vo.id==$category.id?'active': ''}"><a href="{:cmf_url('List/index',['id'=>$vo.id])}">{$vo.name}</a></li>
                    </neq>
                </volist>
            </ul>
            <div class="head-tip">{$car.title|default=''}</div>
            <div class="clearboth"></div>
        </div>
        <div class="list-breadcrumb">
            <a href="{:cmf_url('List/index',['id'=>$category.id])}">全部结果</a>
            <b></b><a href="{:cmf_url('List/index',['id'=>$category.id])}">选车中心</a>
            <notempty name="category.name"><b></b><span>{$category.name|default=''}</span></notempty>
            <notempty name="car.brands.name"><b></b><span>{$car.brands.name|default=''}</span></notempty>
        </div>
        <div class="row no-margin border-t-b-box">
            <div class="col-md-7 padding-ten">
                <present name="car.more.thumbnail">
                    <empty name="car.more.thumbnail">
                        <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                        <else/>
                        <img src="{:cmf_get_image_url($car.more.thumbnail)}" class="img-responsive" alt="">
                    </empty>
                    <else/>
                    <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                </present>
            </div>
            <div class="col-md-5" style="padding-left: 25px;padding-right: 25px;">
                <div class="primary-title ">{$car.title|default=''}</div>
                <div class="info-primary border-top-box">价格：<b class="primary-price">{$car.price|default=''}万</b></div>
                <div class="info-primary border-top-box">类型：<span>{$car.primary.type|default=''}</span></div>
                <div class="info-primary">外观：<span>{$car.primary.exterior|default=''}</span></div>
                <div class="info-primary">内饰：<span>{$car.primary.interior|default=''}</span></div>
                <eq name="category.id" value="$rental_category">
                    <a class="rental-reserve" href="{:cmf_url('rental/Car/reserve',array( 'id'=>$car.id,'cid'=>$car.category_id))}">立即预定</a>
                    <else/>
                    <div class="info-phone-cn"><span>{$theme_vars.phone_cn|default="0755-8222 8223" } </span> </div>
                </eq>

            </div>
        </div>
        <div class="row no-margin ">
            <div class="col-md-8 no-padding">
                <div class="info-content">
                    <div class="title">车型配置：</div>
                    <p>{$car.post_content}</p>
                </div>
            </div>
            <div class="col-md-4" style="padding-right: 0;">
                <div class="info-other">
                    <div class="title">其它车型</div>
                    <php>
                        $where['brand_id']=['eq',$car['brand_id']];
                    </php>
                    <ul class="padding-ten">
                        <rental:cars where="$where" limit="5" order="update_time DESC" categoryIds="$category.id">
                            <li>
                                <a href="{:cmf_url('rental/Car/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">
                                    <div>{$vo.title}<span>{$vo.primary.price}万</span></div>
                                </a>
                            </li>
                        </rental:cars>
                    </ul>
                </div>
            </div>
        </div>
        <div class="info-table">
            <table class="table  table-bordered table-list">
                <thead>
                    <tr class="table-head">
                        <th width="180">车身</th>
                        <th width="220">发动机</th>
                        <th width="180">传动/驱动</th>
                        <th width="200">底盘</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td><span style="float:left">长*宽*高(mm)</span><span style="float:right">{$car.bodywork.length}*{$car.bodywork.width}*{$car.bodywork.height}</span></td>
                        <td><span style="float:left">发动机</span><span style="float:right">{$car.engine.type}</span></td>
                        <td><span style="float:left">变速箱</span><span style="float:right">{$car.drive.gearbox}</span></td>
                        <td><span style="float:left">前悬架类型</span><span style="float:right">{$car.underpan.front_suspension}</span></td>
                    </tr>
                    <tr>
                        <td><span style="float:left">车身结构</span><span style="float:right">{$car.bodywork.structure}</span></td>
                        <td><span style="float:left">最大扭矩</span><span style="float:right">{$car.engine.max_torque}</span></td>
                        <td><span style="float:left">驱动方式</span><span style="float:right">{$car.drive.type}</span></td>
                        <td><span style="float:left">后悬架类型</span><span style="float:right">{$car.underpan.rear_suspension}</span></td>
                    </tr>
                    <tr>
                        <td><span style="float:left">轴距(mm)</span><span style="float:right">{$car.bodywork.wheel_base}</span></td>
                        <td><span style="float:left">最大马力：</span><span style="float:right">{$car.engine.max_horsepower}</span></td>
                        <td>&nbsp;</td>
                        <td><span style="float:left">车体结构</span><span style="float:right">{$car.underpan.structure}</span></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><span style="float:left">燃料形式</span><span style="float:right">{$car.engine.fuel}</span></td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="row text-center">
            <div style="margin-bottom: 40px;">
                <h1 class="title">车型展示</h1>
                <h3 class="sub_title">IMAGE DISPLAY</h3>
            </div>
            <div class="clearboth"></div>
            <div class="info-line"></div>
        </div>
        <notempty name="car.more.excerpts">
            <div class="text-center info-btn"><span>车身图片</span></div>
            <div class="excerpt-img">
                <ul id="excerpt-img">
                    <!-- <notempty name="car.more.excerpts"> -->
                    <foreach name="car.more.excerpts" item="vo">
                        <li id="excerpt-img-{$key}" style="float:left">
                            <img id="exterior-{$key}-preview" src="{:cmf_get_image_preview_url($vo['url'])}" onclick="imagePreviewDialog('excerpt-img');">
                        </li>
                    </foreach>
                    <!-- </notempty> -->
                </ul>
                <div class="clearfix"></div>
                <a id="excerpt-prev" class="prev sy13_prev" href="javascript:;"></a>
                <a id="excerpt-next" class="next sy13_next" href="javascript:;"></a>
            </div>
        </notempty>
        <notempty name="car.more.interiors">
            <div class="text-center info-btn"><span>内饰图片</span></div>
            <div class="excerpt-img">
                <ul id="interior-img">

                    <foreach name="car.more.interiors" item="vo">
                        <li id="excerpt-img-{$key}" style="float:left">
                            <img id="exterior-{$key}-preview" src="{:cmf_get_image_preview_url($vo['url'])}" onclick="imagePreviewDialog('interior-img');">
                        </li>
                    </foreach>

                </ul>
                <div class="clearfix"></div>
                <a id="interior-prev" class="prev sy13_prev" href="javascript:;"></a>
                <a id="interior-next" class="next sy13_next" href="javascript:;"></a>
            </div>
        </notempty>
        <hr class="no-margin" style="margin-top: 60px;" />
        <div class="row text-center">
            <div style="margin-bottom: 40px;">
                <h1 class="title with-title">相同价位</h1>
                <h3 class="sub_title">PARALLEL IMPORTS</h3>
            </div>

            <div class="clearboth"></div>

        </div>
        <div class="info-tab text-center">
            <span class="action" id="with-price">同价位</span>
            <span id="with-brand">同品牌</span>
            <div class="clearboth"></div>
        </div>
        <script>
            $('.info-tab span').click(function() {
                $('.with-title').text('相' + $(this).text());
                $(this).addClass('action').siblings().removeClass('action');
                $('.' + $(this).attr('id') + '-box').show();
                $('.' + $(this).siblings().attr('id') + '-box').hide();
            });
        </script>
        <div class="row with-price-box with">
            <php>
                $with_price_where['price']=['eq',$car['price']];
            </php>

            <rental:cars where="$with_price_where" limit="8" order="update_time DESC" categoryIds="$category.id">
                <div class="col-md-3 car-box">
                    <div class="tc-gridbox ">
                        <a href="{:cmf_url( 'rental/Car/index',array( 'id'=>$vo.id,'cid'=>$vo.category_id))}">
                            <div class="header">
                                <div class="item-image">
                                    <present name="vo.more.thumbnail">
                                        <empty name="vo.more.thumbnail">
                                            <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                            <else/>
                                            <img src="{:cmf_get_image_url($vo.more.thumbnail)}" class="img-responsive" alt="">
                                        </empty>
                                        <else/>
                                        <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                    </present>
                                </div>
                                <h3 class="title">
                                    {$vo.title}
                                </h3>
                                <div class="title price">
                                    <span class="now-price">一口价：{$vo.primary.price}万</span>&nbsp;&nbsp;&nbsp;<span class="m-price">市场价：{$vo.primary.m_price}万</span>
                                </div>
                            </div>
                        </a>
                    </div>
                </div>
            </rental:cars>
            <div class="clearboth"></div>
        </div>
        <div class="row with-brand-box">
            <php>
                $with_brand_where['brand_id']=['eq',$car['brand_id']];
            </php>
            <rental:cars where="$with_brand_where" limit="8" order="update_time DESC" categoryIds="$category.id">
                <div class="col-md-3 car-box">
                    <div class="tc-gridbox ">
                        <a href="{:cmf_url( 'rental/Car/index',array( 'id'=>$vo.id,'cid'=>$vo.category_id))}">
                            <div class="header">
                                <div class="item-image">
                                    <present name="vo.more.thumbnail">
                                        <empty name="vo.more.thumbnail">
                                            <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                            <else/>
                                            <img src="{:cmf_get_image_url($vo.more.thumbnail)}" class="img-responsive" alt="">
                                        </empty>
                                        <else/>
                                        <img src="__TMPL__/public/assets/images/default-thumbnail.png" class="img-responsive" alt="">
                                    </present>
                                </div>
                                <h3 class="title">
                                    {$vo.title}
                                </h3>
                                <div class="title price">
                                    <span class="now-price">一口价：{$vo.primary.price}万</span>&nbsp;&nbsp;&nbsp;<span class="m-price">市场价：{$vo.primary.m_price}万</span>
                                </div>
                            </div>
                        </a>
                    </div>
                </div>
            </rental:cars>
            <div class="clearboth"></div>
        </div>
        <div class="text-center widget-btn" style="margin-bottom: 0px;"><a class="btn btn-rental" href="{:cmf_url('rental/List/index',['id'=>$category.id])}">选择更多</a></div>
    </div>
    <include file="public@footer" />
    <include file="public@scripts" />
    <script src="__TMPL__/public/assets/js/carouFredSel.js "></script>
    <script type="text/javascript">
        /**
         * 查看图片对话框
         * @param img 图片地址
         */


        Wind.use("layer");

        function imagePreviewDialog(obj) {
            //Wind.use("layer", function() {
            layer.photos({
                    // photos: {
                    //     "title": "", //相册标题
                    //     "id": 'image_preview', //相册id
                    //     "start": 0, //初始显示的图片序号，默认0
                    //     "data": [ //相册包含的图片，数组格式
                    //         {
                    //             "alt": "",
                    //             "pid": 666, //图片id
                    //             "src": img, //原图地址
                    //             "thumb": img //缩略图地址
                    //         }
                    //     ]
                    // } //格式见API文档手册页
                    photos: '#' + obj,
                    closeBtn: true,
                    anim: 5, //0-6的选择，指定弹出图片动画类型，默认随机
                    shadeClose: true,
                    area: ['1000px', '600px'],
                    shade: [0.8, '#303232'],
                })
                //});
        }
        $(function() {
            $('#excerpt-img').carouFredSel({
                direction: 'left',
                circular: true,
                infinite: true,
                items: 3,
                align: true,
                auto: true,
                prev: '#excerpt-prev',
                next: '#excerpt-next'
            });
            $('#interior-img').carouFredSel({
                direction: 'left',
                circular: true,
                infinite: true,
                items: 3,
                align: true,
                auto: true,
                prev: '#interior-prev',
                next: '#interior-next'
            });

        });
    </script>
    <hook name="before_body_end" />
</body>

</html>